ADO Components


ADO components are a New feature of Delphi 5. By ADO components you can access the
ActiveX Data Objects. ADO is a database engine which is the same as BDE, but it is
for Microsoft.
Some databases such as Access and MS-SQL can be easily accessed using ADO more than
BDE. When using it you don't need to create Aliases for your
Access tables or your MS-SQL
server. The only thing you need is the connection string that can be built using
a wizard. When you deploy applications that used ADO engine you need to install the
MDAC
library (Microsoft Data Access Components) which can be found in MDAC directory of
Delphi 5 CD. The good news is that, most of Microsoft products such as Office and
MS-SQL used that library so you will not need to install MDAC library in computer
you want to deploy your applications in it.

ADO and Access Databases:

To use ADO for accessing
Access databases do the followings:

- Drop
ADOConnection from ADO page
- On
ConnectionString property of the ADOConnection component, click (...) button
and click
Build.
- Select
Microsoft Jet 4.0 OLE DB Provider
- Click on Connection tab and select your Access database file.
- Turn
LoginPrompt to False if you write the login name and password in your connection
- Drop
ADOTable or ADOQuery
- In ADOTable or ADOQuery Connection property select Connection1
- ADOTable and ADOQuery are datasets so that they can treated as any normal BDE
TTable and TQuery. You can drop a DataSource and any data controls to be linked with
your Access table.


ADO and MS-SQL Server:

To use ADO for accessing MS-SQL server do the followings:

- Drop
ADOConnection from ADO page
- On
ConnectionString property of the ADOConnection component, click (...) button
and click
Build.
- Select
Microsoft OLE DB Provider for SQL Server
- Click on Connection tab and select your Server name, Database Name, and your authentication
type (SQL Authentication or NT Authentication).
- Turn
LoginPrompt to False if you write the login name and password in your connection
- Drop
ADOTable, ADOQuery or ADOStoredProc
- In ADOTable, ADOQuery, or ADOStroedProc Connection property select Connection1
- The rest will be the same as any normal Delphi database architecture (Engine ->
DataSet -> DataSource -> Data Controls)